Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class Microsoft.​Extensions.​Options.​OptionsCache<​TOptions>

Assembly: Microsoft.Extensions.Options

Inheritance: object → OptionsCache

Implemented Interfaces

Caches <typeparamref name="TOptions" /> instances.

Methods

public void
Clear​()
Clears all options instances from the cache.
public TOptions
GetOrAdd​(string name, System.​Func<​TOptions> createOptions)
Gets a named options instance, or adds a new instance created with <paramref name="createOptions" /> .
Returns The options instance.
name The name of the options instance.
createOptions The function used to create the new instance.
public bool
TryAdd​(string name, TOptions options)
Tries to adds a new option to the cache.
Returns <see langword="true" /> if the option was added; <see langword="false" /> if the name already exists.
name The name of the options instance.
options The options instance.
public bool
TryRemove​(string name)
Tries to remove an options instance.
Returns <see langword="true" /> if anything was removed; otherwise, <see langword="false" /> .
name The name of the options instance.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object